Ext.onReady(function() {
	Ext.lib.Ajax.defaultPostHeader += ";charset=utf-8";
		var head = new Ext.Panel( {
			region : 'north',
			border : false,
			html : '<div style="background:url(pic/main1.gif) repeat-x; height:78px;"></div>',
			height : 80
		});
		var foot = new Ext.Panel( {
			region : 'south',
			html : '<div style="background:url(pic/main2.gif) repeat-x; height:33px; ">'
					+ '<div style="float:left;font:normal 12px tahoma, arial, sans-serif, 宋体;margin:10px 0 0 10px;">'
					+ 'Power By:	<span style="color:blue">佛山市安讯智能科技有限公司</span> &nbsp;</div>'
					+ '<div	style="float:right;margin:10px;font:normal 12px tahoma, arial, sans-serif, 宋体;" >'
					+ '版权所有：<a href="http://web.ansure.net">AnSure</a></div>'
					+ '</div>',
			height : 35
		});
		var t1 = new Ext.tree.TreePanel( {
			border : false,
			rootVisible : false,
			root : new Ext.tree.AsyncTreeNode( {
				text : "我的办公桌",
				expanded : true,
				children : [ {
					id : "clientManager",
					text : "查看客户档案",
					leaf : true
				   },{
						id : "manageSL",
						text : "查看采购单",
						leaf : true
				   },{
					id : "createOrder",
					text : "管理订单",
					leaf : true
				   },{
					id : "createShopping",
					text : "管理采购单",
					leaf : true
				   },{
					id : "bvApply",
					text : "查看BV",
					leaf : true
				   },{
					id : "depotManager",
					text : "仓库管理",
					children : [ {
						id : "warehousing",
						text : "产品入库登记",
						leaf : true
					  },{
						id : "picking",
						text : "产品领料登记",
						leaf : true
					  },{
						id : "sale",
						text : "产品出库登记",
						leaf : true
					  },{
						id : "transfer",
						text : "调拨登记",
						leaf : true
					  },{
						id : "inventory",
						text : "盘点登记",
						leaf : true
					  },{
						id : "storage",
						text : "库存管理",
						leaf : true
					}]
				},{
					text : "财务管理",
					children : [{
						text : "销售明细管理",
						children : [ {
							id : "oSell",
							text : "国外销售明细管理",
							leaf : true
					  	}]
				  },{
						text : "费用管理",
						children : [{
							id : "oFee",
							text : "国外费用管理",
							leaf : true
					  	},{
							id : "oTax",
							text : "国外税费管理",
							leaf : true
					  	}]
				  },{
						text : "应收款管理",
						children : [  
						 {
							id : "recei",
							text : "国内应收款管理",
							leaf : true
					  	},{
							id : "oRecei",
							text : "国外应收款管理",
							leaf : true
					  	}]
				  },{
						text : "应付款管理",
						children : [
							{
							id : "shouldPay",
							text : "国内应付款管理",
							leaf : true
					  	},{
							id : "oSpay",
							text : "国外应付款管理",
							leaf : true
					  	}]
				  }]
					
			  }]
			})
		});



		var leftmenu = new LeftMenu( {
			title : '惟合贸易管理系统',
		 trees : [t1]
		});

		var mainTab = new MainingPanel( {
			id: 'mainTab',
			style : 'padding:0 6px 0 0',
			autoScroll : true,
			region : 'center',
			deferredRender : false,
			activeTab : 0,
			resizeTabs : true,
			inTabWidth : 100,
			tabWidth : 90,
			enableTabScroll : true,
			items : [{
				title : '我的首页',
				html : '<div style="background:url(pic/main.gif) no-repeat center middle; height:508px;"></div>'
			}]
		});
		leftmenu.on("nodeClick", function(nodeAttr) {
			mainTab.loadTab(nodeAttr);
		});
		var viewport = new Ext.Viewport( {
			layout : 'border',
			style : 'border:#024459 2px solid;',
			items : [head, foot, leftmenu, mainTab]
		});

	});